package com.jiazhong.boot.ioc.mybatis.test;

import com.jiazhong.boot.commons.bean.Emp;
import com.jiazhong.boot.commons.util.JsonResult;
import com.jiazhong.boot.ioc.mybatis.service.EmpService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@Slf4j
@SpringBootTest
public class App {

    @Resource
    private EmpService service;

    @Test
    public void a() {
        JsonResult result = service.findAll();
        log.info("result:{}", result);
    }

    @Test
    public void b() {
        JsonResult result = service.findByPage(2, 10);
        log.info("result:{}", result);
    }

    @Test
    public void c() {
        JsonResult result = service.find();
        log.info("result:{}", result);
    }

    @Test
    public void d() {
        Emp emp = new Emp();
        emp.setEname("沈坤");
        service.update1(emp, 7969);
    }
}
